Skip to content

Conversation

@ascjones
Copy link
Collaborator

@ascjones ascjones commented Dec 2, 2022

@HCastano reported the following error when using cargo +nighlty test for E2E tests using the new contract-build library. First of all the error is misleading and is an occurrence of #746.

The issue is that the +nightly gets inherited and the assert_channel check fails. This PR removes this check entirely and allows the underlying cargo build command to inherit whatever toolchain the user needs. It still does add RUSTC_BOOTSTRAP in case we are building with stable.

This should now be more in line with cargo philosophy and give more flexibility to contract authors with their toolchain management.

See also #698 where stable toolchain was first introduced.

}

// Allow nightly features on a stable toolchain
cmd.env("RUSTC_BOOTSTRAP", "1");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only required when doing cargo build so have moved it to exec_cargo_for_wasm_target.

let meta = rustc_version::version_meta()?;
let min_version = Version::new(1, 63, 0);
match meta.channel {
Channel::Stable if meta.semver >= min_version => Ok(()),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This min version check can be replaced by adding rust_version to the ink crate, might be a more suitable location for it?

Copy link
Contributor

@HCastano HCastano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants